<?php /* Smarty version Smarty-3.1.13, created on 2013-07-09 13:00:26
         compiled from ".\templates\loan.tpl" */ ?>
<?php /*%%SmartyHeaderCode:683651d56f8b457c76-27504319%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '55cc8ef3506ff195399d3ea415d17a6db8eb77a2' => 
    array (
      0 => '.\\templates\\loan.tpl',
      1 => 1373314606,
      2 => 'file',
    ),
    '76b183ae9ab092866ef1aa82b739ad39fdc5fb7c' => 
    array (
      0 => 'D:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\fin3\\templates\\link.tpl',
      1 => 1373336611,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '683651d56f8b457c76-27504319',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.13',
  'unifunc' => 'content_51d56f8b70bb80_19333310',
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_51d56f8b70bb80_19333310')) {function content_51d56f8b70bb80_19333310($_smarty_tpl) {?><?php if (!is_callable('smarty_function_html_options')) include 'D:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\fin3\\include\\Smarty\\libs\\plugins\\function.html_options.php';
if (!is_callable('smarty_function_html_select_date')) include 'D:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\fin3\\include\\Smarty\\libs\\plugins\\function.html_select_date.php';
?><html>
	<head>
	  <link rel="stylesheet" href="css/style1.css">
	  <link rel="stylesheet" type="text/css" href="./css/main.css" />
    <link rel="stylesheet" type="text/css" href="./css/style.css" />
	</head>
	
  <style type="text/css">
  	input[type="submit"], input[type="reset"] {
    -moz-border-radius: 10px;
    -webkit-border-radius: 10px;  
    border-radius: 10px;
    }

    input[type="submit"], input[type="reset"] {
    
    
    float: right;
      margin: 2em 1em 0 1em;
      width: 10em;
      padding: .5em;
      border: 1px solid #666;
      -moz-border-radius: 10px;
      -webkit-border-radius: 10px;  
      border-radius: 10px;
      -moz-box-shadow: 0 0 .5em rgba(0, 0, 0, .8);
      -webkit-box-shadow: 0 0 .5em rgba(0, 0, 0, .8);
      box-shadow: 0 0 .5em rgba(0, 0, 0, .8);
      color: #fff;
      background: #0a0;
      font-size: 1em;
      line-height: 1em;
      font-weight: bold;
      opacity: .7;
      -webkit-appearance: none;
      -moz-transition: opacity .5s;
      -webkit-transition: opacity .5s;
      -o-transition: opacity .5s;
      transition: opacity .5s;
    }
    
    input[type="submit"]:hover,
    input[type="submit"]:active,
    input[type="reset"]:hover,
    input[type="reset"]:active {
      cursor: pointer;
      opacity: 1;
    }
    
    input[type="submit"]:active, input[type="button"]:active {
      color: #333;
      background: #eee;
      -moz-box-shadow: 0 0 .5em rgba(0, 0, 0, .8) inset;
      -webkit-box-shadow: 0 0 .5em rgba(0, 0, 0, .8) inset;
      box-shadow: 0 0 .5em rgba(0, 0, 0, .8) inset;
    }
    
    input[type="reset"] {
      background: #f33;
    }	
  </style>
  <script src="js/jquery.min.js" ></script>
  <script type="text/javascript">
    $(document).ready(function(){
      var dataString = "partyId=" + $("#partyNameSel").val();
	    $.ajax(
	    {
	      type: "GET",
	      url: "enterNewPartyAjax.php",
	      data: dataString,
	      success:function(data)
	      {
	        $('.partyData').html(data);
	      }
	    });
    });
    
  	var garanter;
    function countDays()
    {
    	var loanAmount        = $("#loanAmount").val();
    	var installmentAmount = $("#installmentAmount").val();
    	if(installmentAmount != "" && installmentAmount != 0)
      {
    	  var installmentDays   = loanAmount/installmentAmount;
    	  $("#installmentDays").val(installmentDays);
    	}
    }
    function findGuaranterId(partyObj)
    {
      var dataString = "partyId=" + $("#partyNameSel").val();
	    $.ajax(
	    {
	      type: "GET",
	      url: "enterNewPartyAjax.php",
	      data: dataString,
	      success:function(data)
	      {
	        $('.partyData').html(data);
	      }
	    });
	    
      $.ajax({
        url:'findGuaranterIdAjax.php',
        data:'fid='+partyObj.value,
        type:'post',
        dataType:'html',
        success:function(msg)
        {
          $('#loanGuaranterSel').val(msg);
        }
      });
    }
  </script>		

	<body>
  	<ul class="menu">
	    <li><a href="#">Home</a></li>
	    <li><a href="index.php">Party Entry</a></li>
	    <li><a href="loan.php">Loan Entry</a></li>
	    <li><a href="loandetail.php">Loan Detail</a></li>
	    <li><a href="account.php">Account</a></li>
	    <li><a href="transaction.php">Transaction</a></li>
	    <li><a href="#">Display</a>
	      <ul>
	        <li><a href="displayClient.php">Parties</a></li>
	        <li><a href="displayLoan.php">Loans</a></li>
	        <li><a href="dispalyTransaction.php">Transactions</a></li>
	        <li><a href="loanreceived.php">LoanReceived</a></li>
	      </ul>
	    </li>
    </ul>
    
<form name="loanForm" id="loanForm" action="loan.php" method="post">
  <table cellpadding="2" cellspacing="0" border="0">
  	<caption>
  		<font style="color:red"><b>Last Loan Id :-> <?php echo $_smarty_tpl->tpl_vars['loanIdFind']->value;?>
</b></font>
  	</caption>
    <tr>
      <td align="right" valign="top" >
  	    <table cellpadding="2" cellspacing="0" border="1">
  	      <tr>
  	        <td colspan="2">
  	        	<h1>Loan Entry</h1>
  	        	<span style="color:red"><?php echo $_smarty_tpl->tpl_vars['msg']->value;?>
</span>
  	        </td>
  	      </tr>
  	      <tr>
  	      	<th align="right">Loan Id</th>
  	      	<td><input type="text"  name="loanId"  id="loanId"></td>
  	      </tr>
  	      <tr>
            <th align="right">Party : </th>
            <td>
              <select name="partyNameSel" id="partyNameSel" onchange="findGuaranterId(this);">
                <option selected=selected value="0">-- New Party --</option>
                <?php echo smarty_function_html_options(array('values'=>$_smarty_tpl->tpl_vars['arrParty']->value['partyId'],'output'=>$_smarty_tpl->tpl_vars['arrParty']->value['partyName']),$_smarty_tpl);?>

              </select>
            </td>
          </tr>
          <tr>
            <th align="right">Date : </th>
            <td><?php echo smarty_function_html_select_date(array('prefix'=>'curDate','field_order'=>"DmY",'month_format'=>"%m",'start_year'=>'-5','end_year'=>'+5','time'=>$_smarty_tpl->tpl_vars['today']->value),$_smarty_tpl);?>
</td>
          </tr>
          <tr>
            <th align="right">Amount : </th>
            <td><input type="text" required=required name="loadAmount" id="loanAmount" onblur="countDays();"></td>
          </tr>
          <tr>
            <th align="right">Interest : </th>
            <td><input type="text" name="loanInterest" id="loanInterest"></td>
          </tr>
          <tr>
            <th align="right">Installment Amount : </th>
            <td><input type="text" name="installmentAmount" required=required id="installmentAmount" onblur="countDays();"></td>
          </tr>
          <tr>
            <th align="right">Installment Days : </th>
            <td><input type="text" name="installmentDays" readonly=readonly id="installmentDays"> </<td>
          </tr>
          <tr>
            <th align="right">Guaranter : </th>
            <td>
              <select name="loanGuaranterSel" id="loanGuaranterSel">
                <option value="">--Guaranter--</option>
                <?php echo smarty_function_html_options(array('values'=>$_smarty_tpl->tpl_vars['arrParty']->value['partyId'],'output'=>$_smarty_tpl->tpl_vars['arrParty']->value['partyName']),$_smarty_tpl);?>

              </select>
              <br />
              <input type="text" name="loanGuaranter" id="loanGuaranter">
            </td>
          </tr>
          <tr>
            <th align="right">Installment Received : </th>
            <td><input type="text" name="installmentReceived"></<td>
          </tr>
        </table> 
      </td>
      <td align="left" valign="top" class="partyData">
      </td>
    </tr>
    <tr>
      <td align="center" colspan="2">
        <input type="reset" name="reset" id="reset" value="Reset">
        <input type="submit" name="loanBtn" id="loanBtn" value="Save">
      </td>
    </tr>
  </table>
</form> 

	</body>
</html><?php }} ?>